package com.heima.feigns.behavior;

import com.heima.model.behavior.dtos.ApArticleRelationDto;
import com.heima.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @Description:
 * @Version: V1.0
 */
@FeignClient("leadnews-behavior")
public interface BehaviorFeign {


    /**
     * 查询当前用户的点赞/不喜欢
     * @param dto
     * @return {"islike": true, "isunlike":false, "entryId": 3}
     */
    @PostMapping("/api/v1/article_relation/one")
    public Map findApArticleRelation(@RequestBody ApArticleRelationDto dto);



    @GetMapping("/api/v1/behavior_entry/one")
    public ApBehaviorEntry findByUserIdOrEquipmentId(@RequestParam("userId") Integer userId,
                                                     @RequestParam("equipmentId") Integer equipmentId);
}
